package com.loveprogrammer.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

/**
 * @ClassName User
 * @Description TODO
 * @Author admin
 * @Date 2024/2/6 17:00
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
//使用JPA注解配置映射关系
@Entity //告诉JPA这是一个实体类（和数据表映射的类）
@Table(name = "tbl_user") //@Table来指定和哪个数据表对应;如果省略默认表名就是user；
public class User {

    @Id //这是一个主键
    @GeneratedValue(strategy = GenerationType.IDENTITY)//自增主键
    private Integer id;

    @Column(name = "nick_name", length = 50)
    private String nickName;

    @Column(name = "account", length = 50)
    private String account;

    @Column(name = "password", length = 50)
    private String password;

    @Column() //省略默认列名就是属性名
    private String email;

}

